package com.ruoyi.app.controller;

import com.ruoyi.app.domain.Rechargerecord;
import com.ruoyi.app.service.RechargerecordService;
import com.ruoyi.app.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RequestMapping("recharger")
@RestController
public class RechargerController {
    @Autowired
    private RechargerecordService rechargerecordService;

    @RequestMapping("Addrecharge")
    public void Addrecharge(@RequestBody Rechargerecord rechargerecord) {
        rechargerecordService.Addrecharge(rechargerecord);
    }

    @RequestMapping("Getrecharge")
    public Result Getrecharge(Integer patientId) {
        List<Rechargerecord> rechargerecords = rechargerecordService.Getrecharge(patientId);
        return Result.ok("获取充值记录成功",rechargerecords);
    }
}
